/*
                    Cursor Class Implementation
*/
#include "Cursor.h"

Cursor::Cursor()
{
    Image = NULL;

    Focus = Point(0,0);

    strName = "";
}

Cursor::~Cursor()
{
    SDL_FreeSurface(Image);
    SDL_FreeSurface(Image_C);
}

int Cursor::setImage(string strFilepath)
{
    Image = IMG_Load(strFilepath.c_str());

    if (Image == NULL)
    {
        return -1;
    }

    return 0;
}

int Cursor::setImage(SDL_Surface *NewImage)
{
    Image = NewImage;

    if (Image == NULL)
    {
        return -1;
    }

    return 0;
}

SDL_Surface* Cursor::getImage()
{
    return Image;
}

int Cursor::setImage_C(string strFilepath)
{
    Image_C = OptimiseAlphaSurface(IMG_Load(strFilepath.c_str()));

    if (Image_C == NULL)
    {
        return -1;
    }

    return 0;
}

int Cursor::setImage_C(SDL_Surface *NewImage)
{
    Image_C = NewImage;

    if (Image_C == NULL)
    {
        return -1;
    }

    return 0;
}

SDL_Surface* Cursor::getImage_C()
{
    return Image_C;
}

void Cursor::setFocus(Point NewFocus)
{
    Focus = NewFocus;
}

void Cursor::setFocus(double nx, double ny)
{
    Focus.x = nx;
    Focus.y = ny;
}

Point Cursor::getFocus()
{
    return Focus;
}
void Cursor::setName(string strNewName)
{
    strName = strNewName;
}

string Cursor::getName()
{
    return strName;
}
